package ${package}

import ${basePackage}.dao.${entity.name}Dao
import ${basePackage}.entity.${entity.name}
import com.ibeetl.admin.core.service.CoreBaseService
import com.ibeetl.admin.core.util.PlatformException
import org.beetl.sql.core.engine.PageQuery
import org.springframework.stereotype.Service
import org.springframework.transaction.annotation.Transactional
import javax.annotation.Resource

/**
 * ${entity.displayName} Service
 */
\@Service
\@Transactional
class ${entity.name}Service: CoreBaseService<${entity.name}>(){

    \@Resource
    private lateinit var ${entity.code}Dao:${entity.name}Dao

    fun queryByCondition(query:PageQuery<*>): PageQuery<${entity.name}>{
        val ret =  ${entity.code}Dao.queryByCondition(query)
        queryListAfter(ret.list)
        return ret
    }

    fun batchDel${entity.name}(ids: List<Long>){
        try {
            ${entity.code}Dao.batchDel${entity.name}ByIds(ids)
        } catch (e: Exception) {
            throw PlatformException("批量删除${entity.displayName}失败", e)
        }
    }
}